<template>
  <img alt="" :src="imagePath" style="margin-right: 4px" />
</template>

<script setup>
import { onMounted, ref } from "vue";
const props = defineProps({
  icon: {
    type: String,
    default: "",
  },
});

const imagePath = ref("");
onMounted(async () => {
  if (!props.icon && !props.type) return;
  try {
    const module = await import(`@/assets/images/system/${props.icon}.png`);
    imagePath.value = module.default;
  } catch (error) {
    console.error("Image not found:", error);
  }
});
</script>

<style scoped lang="scss"></style>
